home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Science / RLaB / help / format < prev    next >
Text File  |  1994-04-25  |  1KB  |  53 lines

  1. format:
  2.  
  3. Syntax:    format ( )
  4.     format ( precision )
  5.     format ( width , precision )
  6.  
  7. Description:
  8.  
  9.     Format sets the output print format for all numeric output. If
  10.     no arguments are supplied, then the output print formats are
  11.     reset to the default values.
  12.  
  13.     If format is called with one argument, then the arguments
  14.     value specifies the format precision. If two arguments are
  15.     supplied, then the 1st specifies the format field width, and
  16.     the second specifies the format precision.
  17.  
  18. Example:
  19.  
  20.     > 123456789.123456789
  21.      1.235e+08
  22.  
  23.     > format(10);
  24.  
  25.     > 123456789.123456789
  26.     123456789.1
  27.  
  28.     > format();
  29.  
  30.     > a = rand(3,3)
  31.      a =
  32.      matrix columns 1 thru 3
  33.              1      0.3331      0.6646  
  34.         0.9745     0.03694     0.08467  
  35.         0.6475      0.1617      0.2041  
  36.  
  37.     > format(10);
  38.     > a
  39.      a =
  40.      matrix columns 1 thru 3
  41.     0.9999996424  0.3330855668  0.6646450162  
  42.     0.9745196104  0.03694454208  0.08467286825  
  43.     0.6474838853  0.1617118716  0.2041363865  
  44.  
  45.     > format(15,10);
  46.     > a
  47.      a =
  48.      matrix columns 1 thru 3
  49.        0.9999996424     0.3330855668     0.6646450162  
  50.        0.9745196104    0.03694454208    0.08467286825  
  51.        0.6474838853     0.1617118716     0.2041363865  
  52.  
  53.